<%@ Page Title="Manage Boards" Language="C#" MasterPageFile="~/Admin/AdminDefault.master" AutoEventWireup="true" CodeFile="ManageBoards.aspx.cs" Inherits="Admin_Boards_ManageBoards" %>

<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="Server">
   <br />    
   <div class="sectiontitle">Manage Boards</div>
   <p> </p>
   <asp:Label CssClass="alarm" ID="lblResult" EnableViewState ="false" Text="" runat="server" Visible="false" />
   <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
        ValidationGroup="ProductValidation" HeaderText="Errors:" 
        EnableViewState="False" />
   
   <p> </p>
   <a href="CreateBoard.aspx">New</a>
   <asp:GridView ID="gvBoards" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="BoardId" onrowdeleting="gvBoards_RowDeleting" onselectedindexchanged="gvBoards_SelectedIndexChanged" 
        >
        <EmptyDataTemplate>
            None Available in this Board.
        </EmptyDataTemplate>
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:HyperLink runat="server" ID="hLnkEdit" Text="Edit" NavigateUrl='<%#Eval("BoardCode","~/Admin/Boards/CreateBoard.aspx?Board={0}") %>' /> 
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField DeleteText="Delete" ShowSelectButton="true" ShowDeleteButton="true"/>
            <asp:BoundField DataField="BoardId" HeaderText="BoardId" 
                SortExpression="BoardId" Visible="false" />
            <asp:BoundField DataField="BoardCode" HeaderText="Board Code" 
                SortExpression="BoardCode" />
            <asp:BoundField DataField="BoardTypeName" HeaderText="Board Type" 
                SortExpression="BoardTypeName" />
            <asp:BoundField DataField="StartDate" HeaderText="Starting Date" 
                SortExpression="StartDate" />
            <asp:CheckBoxField DataField="IsOpen" HeaderText="Open" 
                SortExpression="IsOpen" ItemStyle-HorizontalAlign="Center" />
        </Columns>
   </asp:GridView>
   <br />
   <div>
        <div style="float:right;">
           <asp:GridView ID="gvNotYetApprovedUsers" runat="server" Width="50%" 
                AutoGenerateColumns="False" DataKeyNames="BoardUserId" 
                onrowdeleting="gvNotYetApprovedUsers_RowDeleting" onselectedindexchanging="gvNotYetApprovedUsers_SelectedIndexChanging"
                >
                <EmptyDataTemplate>
                    No Pending Request Left
                </EmptyDataTemplate>
                <Columns>
                    <asp:BoundField DataField="BoardUserId" Visible="false" />
                    <asp:TemplateField HeaderText="Distributor ID">
                        <ItemTemplate>
                            <asp:Literal ID="lnkUserName" runat="server" Text='<%#Eval("DistributorID")%>'></asp:Literal>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Referred By">
                        <ItemTemplate>
                            <asp:Literal ID="lnkReferID" runat="server" Text='<%#Eval("ReferID")%>'></asp:Literal>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Preferred Positions">
                        <ItemTemplate>
                            <asp:RadioButtonList ID="rdBtnPostions" runat="server" DataSource='<%#Bind("Positions") %>'>
                            </asp:RadioButtonList>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="OrderId" HeaderText="Order Id" />
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" 
                                CommandName="Select" Text="Allow" CommandArgument='<%#Eval("BoardUserId")%>'></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" 
                                CommandName="Delete" Text="Decline" CommandArgument='<%#Eval("BoardUserId")%>'></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
           </asp:GridView>
       </div> 
        <asp:TreeView ID="tvBoardStruct" runat="server" ImageSet="Custom"
            NodeIndent="10" PopulateNodesFromClient="False"
            ShowExpandCollapse = "false" >
            <ParentNodeStyle Font-Bold="True" ForeColor="#5555DD" />
            <HoverNodeStyle Font-Underline="False" />
            <SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" 
                VerticalPadding="0px" />
            <NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" 
                HorizontalPadding="5px" NodeSpacing="10px" VerticalPadding="0px" />
       </asp:TreeView>
       
       
   </div>
   
    
</asp:Content>

